<section class="content-header">
    <h1>添加管理员</h1>
</section>

<section class="content">
    <div class="box box-primary">
        <form class="form-horizontal" name="admins_creat_form" novalidate="novalidate" ng-submit="adminsCreatForm()">
            <div class="box-body">
                <div class="form-group pt7" ng-class="{'has-success': admins_creat_form.username.$dirty && admins_creat_form.username.$valid && !admins_creat_form.username.$focused, 'has-error': admins_creat_form.username.$dirty && admins_creat_form.username.$invalid && !admins_creat_form.username.$focused}">
                    <label for="username" class="col-sm-2 control-label">用户名</label>
                    <div class="col-sm-9">
                        <input type="text" class="form-control" id="username" name="username" ng-model="admin.username" placeholder="用户名" ng-focus required />
                    </div>
                </div>
                <div class="form-group pt7" ng-class="{'has-success': admins_creat_form.password.$dirty && admins_creat_form.password.$valid && !admins_creat_form.password.$focused, 'has-error': admins_creat_form.password.$dirty && admins_creat_form.password.$invalid && !admins_creat_form.password.$focused}">
                    <label for="password" class="col-sm-2 control-label">密码</label>
                    <div class="col-sm-9">
                        <input type="password" class="form-control" id="password" name="password" ng-model="admin.password" placeholder="请输入密码" ng-focus required />
                    </div>
                </div>
                <div class="form-group pt7" ng-class="{'has-success': !admins_creat_form.password2.$pristine && admins_creat_form.password2.$valid, 'has-error': !admins_creat_form.password2.$pristine && admins_creat_form.password2.$invalid}">
                    <label for="password2" class="col-sm-2 control-label">确认密码</label>
                    <div class="col-sm-9">
                        <input type="password" class="form-control" id="password2" name="password2" ng-model="admin.password2" placeholder="请再次输入密码" ng-focus required pw-check="password" />
                    </div>
                    <span class="col-sm-2"></span>
                    <span class="col-sm-9" ng-show="!admins_creat_form.password2.$pristine && admins_creat_form.password2.$invalid" style="color: #dd4b39;">两次输入的密码不一致</span>
                </div>
                <div class="form-group pt7" ng-class="{'has-success': admins_creat_form.name.$dirty && admins_creat_form.name.$valid && !admins_creat_form.name.$focused, 'has-error': admins_creat_form.name.$dirty && admins_creat_form.name.$invalid && !admins_creat_form.name.$focused}">
                    <label for="name" class="col-sm-2 control-label">管理员名字</label>
                    <div class="col-sm-9">
                        <input type="text" class="form-control" id="name" name="name" ng-model="admin.name" placeholder="管理员名字" ng-focus required />
                    </div>
                </div>
            </div>
            <div class="box-footer">
                <button type="submit" class="btn btn-primary pull-right" ng-disabled="admins_creat_form.$invalid">添加</button>
            </div>
        </form>
    </div>
</section>